Text Item
Objects of class Text Item are delimited by any of the characters specified by the Scriptable Text Editor's Text Item Delimiters property or by the beginning or end of a container. You can modify the Text Item Delimiters property, but such changes are lost when the user quits the application.PROPERTIES
Font
- The name of the font of the text item. If the font varies
within the text item, the Font property specifies the font
of the first character.
Class: String
Modifiable? YesLength
- The number of characters in a text object.
Class: Integer
Modifiable? NoOffset
- The offset, in characters, from the beginning of the document to the first character of a text object.
Class: Integer
Modifiable? NoSize
- The size, in points, of the text item. If the size varies within the text item, the Size property specifies the size of the first character.
Class: Integer
Modifiable? YesStyle
- The text styles of a text object. If the text styles vary within
the text item, the Style property specifies the styles of the
first character.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. The On Styles property specifies the styles that apply to the text object. The Off Styles property specifies the styles that do not apply to the text object. Both properties are lists of constants that specify text styles. See "Elements of Text Objects" on page 314 for information
about how styles are used. The constants that can be used in Style property lists arebold
,italic
,outline
,underline
, andshadow
.
Modifiable? YesUniform Styles
The text styles that are uniformly "on" or "off" for all characters of a text object.
Class: Text Style Info. Objects of this class have two properties: On Styles and Off Styles. The On Styles property specifies the styles that apply to all the characters of the text object. The Off Styles property specifies the styles that do not apply to any of the characters of the text object. Both properties are lists of constants that specify text styles. If a style does not appear in either list, the style applies to some but not all of the characters in the object. See "Elements of Text Objects" on page 314 for information about how styles are used. The constants that can be used in Uniform Styles property lists arebold
,italic
,outline
,underline
, andshadow
.
Modifiable? NoELEMENT CLASSES
See "Elements of Text Objects" on page 314 for a general discussion of these element classes.
- Character
- Characters contained in the text items
- Paragraph
- Paragraphs contained in the text items
- Text
- Series of characters contained in the text items
- Text Item
- Text items contained in the text items
- Word
- Words contained in the text items
COMMANDS HANDLED
Copy, Count, Cut, Data Size, Delete, Duplicate, Exists, Get, Make, Move,
Select, SetDEFAULT VALUE CLASS RETURNED
Styled TextEXAMPLE
tell document "Report" of app "Scriptable Text Editor" copy text item 2 to x end tellIn this example, if the document Report begins with "Tomato, Banana, Pineapple", then the value ofx
is"Banana"
.NOTE
The characters used to separate text item objects are specified in the Scriptable Text Editor's Text Item Delimiters property. At startup the default value of the Scriptable Text Editor's Text Item Delimiters property is a single-item list that contains a comma: {",
"}. You can set this delimiter to a different value or add additional delimiters, but the new values are lost when the user quits the application.